package me.ele.spring.cloud.controller;

import me.ele.spring.cloud.client.AClient;
import me.ele.spring.cloud.client.UserClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by enan on 16/8/26.
 */
@RestController
public class ConsumerController {

    @Autowired
    UserClient userClient;

    @Autowired
    AClient aClient;

    @RequestMapping(value = "/add", method = RequestMethod.GET)
    public Integer add() {
        int result = userClient.add(10, 20);
        System.out.println(result);
        return result;
    }

    @RequestMapping(value = "/a", method = RequestMethod.GET)
    public String a() {
        return aClient.a();
    }
}
